/*------------------------------------------------------
                hou_elearningGEN beta v1.0
Author: xtrung.net@gmail.com
Write On: 04/27/2008
Create On:4/13/2012 11:22:49 AM
------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
namespace hou_elearning.Entity
{
    public class NguoidungEntity
    {
        public NguoidungEntity()
        {
			m_pk_inguoidungid=0;
			m_stendangnhap="";
			m_smatkhau="";
			m_shoten="";
			m_semail="";
			m_ssodienthoai="";
			m_dngaysinh=DateTime.Now;
			m_bgioitinh=false;
			m_sdiachi="";
            m_sghichu = "";
			m_banhthe=null;
        }
		private Int64 m_pk_inguoidungid;
		public Int64 PK_iNguoidungID
		{
			get { return m_pk_inguoidungid ; }
			set { m_pk_inguoidungid = value; }
		}
		private String m_stendangnhap;
		public String sTendangnhap
		{
			get { return m_stendangnhap ; }
			set { m_stendangnhap = value; }
		}
		private String m_smatkhau;
		public String sMatkhau
		{
			get { return m_smatkhau ; }
			set { m_smatkhau = value; }
		}
		private String m_shoten;
		public String sHoten
		{
			get { return m_shoten ; }
			set { m_shoten = value; }
		}
		private String m_semail;
		public String sEmail
		{
			get { return m_semail ; }
			set { m_semail = value; }
		}
		private String m_ssodienthoai;
		public String sSodienthoai
		{
			get { return m_ssodienthoai ; }
			set { m_ssodienthoai = value; }
		}
		private DateTime m_dngaysinh;
		public DateTime dNgaysinh
		{
			get { return m_dngaysinh ; }
			set { m_dngaysinh = value; }
		}
		private Boolean m_bgioitinh;
		public Boolean bGioitinh
		{
			get { return m_bgioitinh ; }
			set { m_bgioitinh = value; }
		}
		private String m_sdiachi;
		public String sDiachi
		{
			get { return m_sdiachi ; }
			set { m_sdiachi = value; }
		}
        private String m_sghichu;
        public String sGhichu
        {
            get { return m_sghichu; }
            set { m_sghichu = value; }
        }
		private Byte[] m_banhthe;
		public Byte[] bAnhthe
		{
			get { return m_banhthe ; }
			set { m_banhthe = value; }
		}

        #region Comparison
        public static List<NguoidungEntity> Sort(List<NguoidungEntity> list, String SortExpression, String SortDirection)
        {
            string strComparisonAttrb="COMPARISON_"+SortExpression;
            PropertyInfo propInfo= typeof(NguoidungEntity).GetProperty(strComparisonAttrb);
            if (propInfo != null)
            {
                list.Sort(propInfo.GetGetMethod().Invoke(null,null) as Comparison<NguoidungEntity>);
                if (SortDirection == "DESC")
                    list.Reverse();
            }
            return list;
        }
        
		public static Comparison<NguoidungEntity> COMPARISON_PK_iNguoidungID
		{
			get
			{
				return delegate(NguoidungEntity entity,NguoidungEntity other)
				{
					return entity.PK_iNguoidungID.CompareTo(other.PK_iNguoidungID);
				};
			}
		}
		public static Comparison<NguoidungEntity> COMPARISON_sTendangnhap
		{
			get
			{
				return delegate(NguoidungEntity entity,NguoidungEntity other)
				{
					return entity.sTendangnhap.CompareTo(other.sTendangnhap);
				};
			}
		}
		public static Comparison<NguoidungEntity> COMPARISON_sMatkhau
		{
			get
			{
				return delegate(NguoidungEntity entity,NguoidungEntity other)
				{
					return entity.sMatkhau.CompareTo(other.sMatkhau);
				};
			}
		}
		public static Comparison<NguoidungEntity> COMPARISON_sHoten
		{
			get
			{
				return delegate(NguoidungEntity entity,NguoidungEntity other)
				{
					return entity.sHoten.CompareTo(other.sHoten);
				};
			}
		}
		public static Comparison<NguoidungEntity> COMPARISON_sEmail
		{
			get
			{
				return delegate(NguoidungEntity entity,NguoidungEntity other)
				{
					return entity.sEmail.CompareTo(other.sEmail);
				};
			}
		}
		public static Comparison<NguoidungEntity> COMPARISON_sSodienthoai
		{
			get
			{
				return delegate(NguoidungEntity entity,NguoidungEntity other)
				{
					return entity.sSodienthoai.CompareTo(other.sSodienthoai);
				};
			}
		}
		public static Comparison<NguoidungEntity> COMPARISON_dNgaysinh
		{
			get
			{
				return delegate(NguoidungEntity entity,NguoidungEntity other)
				{
					return entity.dNgaysinh.CompareTo(other.dNgaysinh);
				};
			}
		}
		public static Comparison<NguoidungEntity> COMPARISON_bGioitinh
		{
			get
			{
				return delegate(NguoidungEntity entity,NguoidungEntity other)
				{
					return entity.bGioitinh.CompareTo(other.bGioitinh);
				};
			}
		}
		public static Comparison<NguoidungEntity> COMPARISON_sDiachi
		{
			get
			{
				return delegate(NguoidungEntity entity,NguoidungEntity other)
				{
					return entity.sDiachi.CompareTo(other.sDiachi);
				};
			}
		}
        public static Comparison<NguoidungEntity> COMPARISON_bAnhthe
        {
            get
            {
                return delegate(NguoidungEntity entity, NguoidungEntity other)
                {
                    if (entity.bAnhthe.Equals(other.bAnhthe) == true)
                        return 1;
                    else
                        return 0;
                };
            }
        }
        #endregion
    }
}
